how to code tic tac toe in java